# Sample makefile
!include <win32.mak>
ARMSTORM=armstorm.exe
ARMSTORM_OBJS=..\..\..\src\main.obj

ARMSTORM_LIB=armstorm.lib
ARMSTORM_LIB_OBJS=..\..\..\src\arm.obj \
                  ..\..\..\src\armstorm.obj \
                  ..\..\..\src\common.obj \
                  ..\..\..\src\defs.obj \
                  ..\..\..\src\thumb.obj \
                  ..\..\..\src\thumb_db.obj

# Compiler Flags
CFLAGS=$(cdebug) $(cflags) $(cvars) /I..\..\..\src /D_CRT_SECURE_NO_WARNINGS

# Linker Flags
LFLAGS=$(ldebug) $(conflags) /OUT:$(ARMSTORM)
LIBS=$(conlibs) $(ARMSTORM_LIB)

# Default rule to compile when no rule is specified in
#    the command line.
all: $(ARMSTORM)

# Default rule to compile .c files into .obj files
.c.obj:
  $(cc) $(CFLAGS) $*.c /Fo$*.obj

$(ARMSTORM_LIB): $(ARMSTORM_LIB_OBJS)
	lib $(ARMSTORM_LIB_OBJS) /out:$(ARMSTORM_LIB)
  
# Rule to compile the armveil application
$(ARMSTORM): $(ARMSTORM_LIB) $(ARMSTORM_OBJS)  
	$(link) $(LFLAGS) $(ARMSTORM_OBJS) $(LIBS)

# Clean Rule: Removes all the objects and build files
#    in order to bring the project back into a clean 
#    state.
clean:
	DEL /Q $(ARMSTORM_OBJS)
	DEL /Q $(ARMSTORM_LIB_OBJS)
	DEL /Q $(ARMSTORM_LIB)
	DEL /Q $(ARMSTORM)
	DEL /S /Q *.pdb
